import "package:flutter/material.dart";
import 'package:flutter_appdemo02/page/One.dart';
import 'package:flutter_appdemo02/page/Three.dart';
import 'package:flutter_appdemo02/page/Two.dart';

class Tabs extends StatefulWidget {
  @override
  _TabsState createState() => _TabsState();
}

class _TabsState extends State<Tabs> {
  AnimationController _controller;
  int _currentIndex = 0;

  List _pageList = [
    OnePage(),
    TwoPage(),
    Three(),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body:
            this._pageList[this._currentIndex],
            bottomNavigationBar: BottomNavigationBar(
                currentIndex: this._currentIndex,
                onTap: (int index) {
                  setState(() {
                    this._currentIndex = index;
                  });
                },
                fixedColor: Colors.pinkAccent,
                items: [
                  BottomNavigationBarItem(
                    icon: Icon(Icons.home),
                    title: Text("one"),
                  ),
                  BottomNavigationBarItem(
                      icon: Icon(Icons.category),
                      title: Text("two")),
                  BottomNavigationBarItem(
                      icon: Icon(Icons.book),
                      title: Text("three")),
                ]),

    );
  }
}
